# import requests

# # 1. 设置参数
# params = {
#     "user-agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0"
# }
# target_url = "https://www.baidu.com/s?wd=%E9%A1%BA%E4%B8%B0&rsv_spt=1&rsv_iqid=0xb62d0fe200224215&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_dl=tb&rsv_sug3=7&rsv_sug1=5&rsv_sug7=100&rsv_btype=i&inputT=3565&rsv_sug4=5975"
# # 2. 发送请求
# res = requests.get(target_url, params=params)
# # 3. 响应
# res.encoding = "utf-8"
# print(res.text)

# User-Agent模块
# from fake_useragent import UserAgent
# print(UserAgent().random)

import requests

target_url = "https://cn.bing.com/search?"

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0"
}
params = {
    "q": "顺丰"
}
res = requests.get(target_url, params=params, headers=headers)
res.encoding = "utf-8"

with open("01.html", 'w', encoding="utf-8") as f:
    f.write(res.text)
